﻿using System;
using System.Collections.Generic;
using System.Text;
using XDesigner.ORM;

namespace XDesigner.ORM.Test
{
    [ORMType("OrderDetails")]
    [System.ComponentModel.TypeConverter(typeof(MyTypeConverter))]
    public class OrderDetailClass
    {
        private int _RecordID = 0;
        [ORMKeyField()]
        public int RecordID
        {
            get { return _RecordID; }
            set { _RecordID = value; }
        }

        //private int _OrderID = 0;

        //public int OrderID
        //{
        //    get { return _OrderID; }
        //    set { _OrderID = value; }
        //}

        private OrderClass _Order = null;
        [ORMRelation(ORMRelationStyle.OneToOne)]
        [ORMField("OrderID")]
        [ORMDelay()]
        public virtual OrderClass Order
        {
            get { return _Order; }
            set { _Order = value; }
        }

        //private int _ProductID = 0;

        //public int ProductID
        //{
        //    get { return _ProductID; }
        //    set { _ProductID = value; }
        //}

        private ProductClass _Product = null;
        [ORMRelation( ORMRelationStyle.OneToOne )]
        [ORMField("ProductID")]
        [ORMDelay()]
        public virtual ProductClass Product
        {
            get { return _Product; }
            set { _Product = value; }
        }

        private decimal _UnitPrice = 0;

        public decimal UnitPrice
        {
            get { return _UnitPrice; }
            set { _UnitPrice = value; }
        }

        private int _Quantity = 0;

        public int Quantity
        {
            get { return _Quantity; }
            set { _Quantity = value; }
        }

        private float _Discount = 0f;

        public float Discount
        {
            get { return _Discount; }
            set { _Discount = value; }
        }
    }
}
